import '../../helper/dioHelper2.dart';

class SKData1 {
  String TM;
  double Q;
  double R;
  double H;
  double QD;
  double RD;
  double HD;
  double KT;

  SKData1(this.TM, this.Q, this.R, this.H, this.QD, this.RD, this.HD, this.KT);
  SKData1.fromJson(Map<String, dynamic> json)
      : TM = json["TM"],
        Q = json["Q"] * 1.0,
        R = json["R"] * 1.0,
        H = json["H"] * 1.0,
        QD = json["QD"] * 1.0,
        RD = json["RD"] * 1.0,
        HD = json["HD"] * 1.0,
        KT = json["KT"] * 1.0;
  Map<String, dynamic> toJson() => {
        'TM': TM,
        'Q': Q,
        'R': R,
        'H': H,
        'QD': QD,
        'RD': RD,
        'HD': HD,
        'KT': KT,
      };

  static Future<SKData1> GetNew() async {
    var response = await DioHelper.Get("/SdzxData/GetSKData", {});

    if (response.statusCode == 200) {
      return SKData1.fromJson(response.data);
    }

    return null as SKData1;
  }
}

class SKData2 {
  String TM;
  double R1;
  double R2;
  double R3;
  double E1;
  double E2;
  double E3;

  SKData2(this.TM, this.R1, this.R2, this.R3, this.E1, this.E2, this.E3);
  SKData2.fromJson(Map<String, dynamic> json)
      : TM = json["TM"],
        R1 = json["R1"] * 1.0,
        R2 = json["R2"] * 1.0,
        R3 = json["R3"] * 1.0,
        E1 = json["E1"] * 1.0,
        E2 = json["E2"] * 1.0,
        E3 = json["E3"] * 1.0;
  Map<String, dynamic> toJson() => {
        'TM': TM,
        'R1': R1,
        'R2': R2,
        'R3': R3,
        'E1': E1,
        'E2': E2,
        'E3': E3,
      };

  static Future<SKData2> GetNew() async {
    var response = await DioHelper.Get("/SdzxData/GetSKData2", {});

    if (response.statusCode == 200) {
      return SKData2.fromJson(response.data);
    }

    return null as SKData2;
  }
}
